//
//  SandBoxDemo.h
//  往沙盒中存数据和取数据Demo
//
//  Created by 向祖华 on 16/3/31.
//  Copyright © 2016年 向祖华. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "Person.h"

@interface SandBoxDemo : NSObject

#pragma mark -- doc文件管理
//Doc存数据
+(BOOL)storeDataWithString:(NSString*)str key:(NSString*)key;
//Doc取数据
+(NSString *)takeDataWithKey:(NSString*)key;
//Doc删除数据
+(BOOL)deletDataWithKey:(NSString*)key;
#pragma mark -- temp文件管理
//temp中存数据
+(BOOL)tempStoreDataWithArray:(NSArray*)arr Key:(NSString*)key;
//temp中取数据
+(NSArray *)tempTakeDataWithKey:(NSString*)key;
//temp中删除数据
+(BOOL)tempDeletDataWithKey:(NSString*)key;
#pragma mark -- caches文件管理
//Cashes中存数据
+(BOOL)cachesStoreDataWithImage:(UIImage*)image key:(NSString*)key;
//Cashes中取数据
+(UIImage*)cachesTakeDataWithKey:(NSString*)key;
//Cashes中删除数据
+(BOOL)cachesDeleteDataWithKey:(NSString*)key;
#pragma mark -- 文件夹管理
//在temp中创建文件夹
+(BOOL)creatFileWithKey:(NSString*)key;
//往temp文件夹中写入简单数据
+(BOOL)writDataWithString:(NSString*)str key:(NSString*)key;
//把文件夹移到caches中
+(BOOL)moveFileWithKey:(NSString*)key;
//删除temp文件夹中的文件夹
+(BOOL)deleteFileWithKey:(NSString*)key;
//复制文件夹到doc文件夹中
+(BOOL)copyFileWithKey:(NSString *)key;


#pragma mark -- 归档与反归档
//归档
+(BOOL)encodeWithData:(Person*)person key:(NSString*)key;
//反归档
+(Person*)decodeWithKey:(NSString*)key;






@end
